package com.webex.ta.hydra.core.engine;

import java.util.HashMap;
import java.util.Map;
import java.util.Vector;

/**
 * Created by IntelliJ IDEA.
 * User: vegaz
 * Date: 2010-8-30
 * Time: 13:51:51
 * To change this template use File | Settings | File Templates.
 */
public class HydraVariables {
    private Map<String, HydraVariable> variables = new HashMap<String, HydraVariable>();

    public void put(String key, Object value) {
        variables.put(key, new HydraVariable(key, value));
    }

    public void remove(String key) {
        variables.remove(key);
    }

    public String getStringValue(String key) {
        if (variables.containsKey(key)) {
            return variables.get(key).getValue().toString();
        }
        return null;
    }

    public Object getObjectValue(String key) {
        if (variables.containsKey(key)) {
            return variables.get(key).getValue();
        }
        return null;
    }

    public Vector<HydraVariable> getVariableDetails() {
        return new Vector<HydraVariable>(variables.values());
    }
}
